package com.validator;

import java.io.File;

import com.opensymphony.xwork2.validator.ValidationException;
import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;

public class IsFileUpload  extends FieldValidatorSupport{
	private File upload;
	private String uploadFileName;
	@Override
	public void validate(Object o) throws ValidationException {
		Object objUploadFileName = getFieldValue(uploadFileName, o);
		String fieldName = getFieldName();
		File fieldValue = (File) getFieldValue(fieldName, o);
		if (fieldValue == null) {
			addFieldError(fieldName, o);
		}
	}
	public File getUpload() {
		return upload;
	}
	public void setUpload(File upload) {
		this.upload = upload;
	}
	public String getUploadFileName() {
		return uploadFileName;
	}
	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}
	
	
	

}
